<template>
  <div class="wrapper">
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="item of this.list" :key="item.id">
        <img class="swiper-img" :src="defaultImg" alt="">
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
    list: Array
  },
  data () {
    return {
      swiperOptions: {
        pagination: '.swiper-pagination',
        loop: true,
        autoplay: 3000
      },
      defaultImg: 'http://img1.qunarzz.com/sight/p0/1907/90/903428cd6de6a2c1a3.img.jpg_r_800x800_dc4abb35.jpg'
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet-active
    background #fff
  .wrapper
    overflow hidden
    width 100%
    height 31.25vw
    background #eee
    .swiper-container
      height 100%
      .swiper-img
        width 100%
</style>
